package cn.newgrand.common;
/**
 * netcall工具类
 * 
 * @author sidneyren
 *
 */
public class NetcallUtil {
	
	/**
	 * 取jid的@前面的信息，即node或者成为username
	 * 
	 * @param jid
	 * @return
	 */
	public static String getUserOrRoomName(String jid){
		return jid.substring(0,jid.indexOf('@'));
	}
	/**
	 * 判断一个String类型的jid是否包含node/username/名字
	 * 即是否包含"@"字符
	 * @return
	 */
	public static boolean isIncludedNode(String jid){
		return jid.contains("@");
	}
	
	public static String getBareJID(String jid){
		if(jid.indexOf("/")!=-1)
			return jid.substring(0,jid.indexOf('/'));
		else
			return jid;
	}
}
